1. Technical Field
The invention relates to a security protocol. Particularly, the invention relates to a data encryption method, a data verification method and an electronic apparatus.
2. Related Art
A main encryption technique includes an asymmetric-key algorithm and a symmetric-key algorithm, where the asymmetric-key algorithm is also referred to as a public-key cryptography, which includes message-digest algorithm 5 (MD5), RSA, etc., and the asymmetric-key algorithm includes data encryption standard (DES), an international data encryption algorithm (IDEA), and an advanced encryption standard (AES), etc.
A deciphering party (for example, a network service provider) probably masters the encryption and decryption technique, and can directly decipher data after obtaining a ciphertext. Although it can prevent the direct deciphering in a certain degree by using a public key, a private key or a single key (probably having a random sequence) to encrypt and decrypt data, preserving security of the key cannot be guaranteed, which can be a threat for the user's data.
In order to avoid the problem on key security, ordinary two-way encryption is applied, i.e. a key (probably having a random sequence) is used to encrypt data to generate a ciphertext, though the key is preserved nowhere, for example, in the asymmetric-key algorithm, the public key is used to encrypt data into the ciphertext, and the private key is preserved nowhere and is directly encrypted with the ciphertext to generate a final ciphertext. Regarding encryption of the symmetric-key algorithm, after the single key is encrypted, the encrypted single key is again encrypted with the ciphertext. According to such method, once a decryption algorithm is leaked, the key can be easily obtained through deciphering, so that it is still insecure in some degree.